package com.pikaqiu.warehouse.controller;

/**
 * @Author: Administrator
 * @Date: 2024/8/14
 */

import com.pikaqiu.warehouse.domain.common.MiniAjaxResult;
import com.pikaqiu.warehouse.domain.dto.UserDto;
import com.pikaqiu.warehouse.service.UserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/user")
public class UserController {


    @Resource
    private UserService userService;

    @PostMapping("/login")
    public MiniAjaxResult<UserDto> login(HttpServletRequest request, String code) {
        return MiniAjaxResult.success(userService.login(request, code));
    }
}
